**Analysis for Harbridge-Yong and Paris LSQ

clear all
capture log close
set more off 
*Set working directory
cd "..."  //SET WORKING DIRECTORY HERE

use "Study_1_SSI_raw_for_replication.dta", clear

*Run cleaning and data set up
run Study_1_SSI_set_up.do 

**Create indicator for answering  two main DVs (bill and cong)
gen answer_main=0
replace answer_main=1 if o_cong!=. & o_bill!=.

*save data ready for analysis
save "Study_1_Agenda_Clean_SSI.dta", replace 



**************************
* Demographics of Sample *
**************************

tab control, sum(manip_correct) 
	* 62% correct in treatment, 47% correct in control
sum manip_correct
	*overall 54%
tab fulltreat
tab fulltreat, sum(manip_correct)

tab fulltreat full_treatment if answer_main==1

**Appendix Table Demographics
**Gender
tab gender if answer_main==1 // 48.43% male, 51.57% female (aiming for 49% male, 51% female)

**age
tab age if answer_main==1 //
**Aiming for 
**18-24=17%
**25-34=17% 
*35-44=18% 
*45-54=18%
*55-64=14%
*65+= 14%

**Quotas by region
tab region_ne if answer_main==1 //17.8% (aiming for 16%)
tab region_mw if answer_main==1 //22.47% (aiming for 23%)
tab region_so if answer_main==1 //38.59% (aiming for 37%)
tab region_we if answer_main==1 //21.86% (aiming for 24%)

**race
tab race if answer_main==1 //

**party
tab pid1to3 if answer_main==1 //uses initial question, before separating leaners and pure independents

**Balance tests (not in table but referenced)
set more off
log using "output\chi2tests", replace
tabulate race full_treatment if answer_main==1, chi2
tab gender full_treatment if answer_main==1, chi2
tab state full_treatment if answer_main==1, chi2
tab region full_treatment if answer_main==1, chi2
tab pid3 full_treatment if answer_main==1, chi2
tab pid1to3 full_treatment if answer_main==1, chi2
tab age full_treatment if answer_main==1, chi2
tab k_correct_sum full_treatment if answer_main==1, chi2
log close
* no significant differences across treatment categories in terms of demographics

**Full quotas checked in cleaning file

**Note in full_treatment, 1=bipartisan, 2=minority

 
 